"""
Hongyu (Vicky) Ye (Worked with Ruben Kahloun)
02/10/2021
Section #03
Problem #1: Compound Interest

""" 

print("This program will project how much you can earn by investing money in a high-yield savings account over a 3 month period.")
money1 = float(input("To begin, enter how much money you would like to initially invest (i.e. 500): "))
interest_rate = float(input("Next, enter your projected annual interest rate. For example, enter 5 for 5%: "))

# Math computations
monthly_rate = interest_rate/100/12
monthly_rate_rounded = round(monthly_rate, 2)


# Month 1
month1_interest = money1 * monthly_rate
month1_interest = round(month1_interest, 2)
month1_ending = money1 + month1_interest
#month1_ending_rounded = round(month1_ending, 2)

# Month 2
month2_interest = month1_ending * monthly_rate
month2_interest = round(month2_interest, 2)
month2_ending = month1_ending + month2_interest
#month2_ending_rounded = round(month2_ending, 2)

# Month 3
month3_interest = month2_ending * monthly_rate
month3_interest = round(month3_interest, 2)
month3_ending = month2_ending + month3_interest
#month3_ending_rounded = round(month3_ending, 2)

'''
month1_ending_rounded = round(month1_ending, 2)
month2_ending_rounded = round(month2_ending, 2)
month3_ending_rounded = round(month3_ending, 2)
'''


# Format
print()
print('------- Calculating --------')
print()

h1 = format("Month", "<10s")
h2 = format("Starting Balance", "<20s")
h3 = format("Interest", "<10s")
h4 = format("Ending Balance", )
print (h1, h2, h3, h4)

a1 = format(1, "<10d")
b1 = format(money1, "<20.2f")
c1 = format(month1_interest, "<10.2f")
d1 = format(month1_ending,"<20.2f")
print (a1, b1, c1, d1)

a2 = format(2, "<10d")
b2 = format(month1_ending, "<20.2f")
c2 = format(month2_interest, "<10.2f")
d2 = format(month2_ending,"<20.2f")
print (a2, b2, c2, d2)

a3 = format(3, "<10d")
b3 = format(month2_ending, "<20.2f")
c3 = format(month3_interest, "<10.2f")
d3 = format(month3_ending,"<20.2f")
print (a3, b3, c3, d3)
